<template>
  <div>
     <el-form>
       <el-form-item label="">
       	<el-button size="mini" @click="isShow=true" type="primary">选择图片</el-button>
       </el-form-item>
       <el-form-item label="" v-if="url">
         <div style="display: flex;">
       	  <div style="position: relative;margin-right: 10px;"
       		>
       		  <img style="width: 100px;height: 100px;" :src="$baseUrl + '/storage/' + url" alt="">
       		  <i @click="removeUrl" class="el-icon-circle-close" style="font-size: 20px;position: absolute;top: 0;right:0;cursor: pointer;"></i>
       	  </div>
         </div>
       </el-form-item>
     </el-form>
     <el-dialog title="选择图片"
     		:close-on-click-modal="false"
     		:modal-append-to-body="false"
     		:append-to-body="true"
             :visible.sync="isShow"
             width="1050px">
     	 <div style="padding-bottom: 30px;">
     		 <imgSys @getImgData="getImgData" />
     	 </div>

     </el-dialog>
  </div>
</template>

<script>
  import imgSys from '@/components/imgSys'
  export default {
    components:{
      imgSys
    },
    data(){
      return {
        isShow:false,
        url:""
      }
    },
    methods:{
        removeUrl(){
          this.url = ''
          this.$emit('getImgUrl',this.url)
        },
        getImgData(val){
           this.isShow = false
           this.url = val
           this.$emit('getImgUrl',this.url)
        },
    }
  }
</script>

<style>
</style>
